﻿using System.Collections.Generic;
using System.Drawing;

namespace PiUi
{
    public static class ThemeColor
    {

        public static Color PrimaryColor { get; set; }
        public static Color SecondaryColor { get; set; } = Color.White;

        public  static   List<string> m_ColorList = new List<string>() {
                            "#3F51B5", "#009688", "#FF5722", "#607D8B", "#FF9800",
                            "#9C27B0", "#2196F3", "#EA676C", "#EA414A", "#5978BB",
                            "#018790", "#0E3441", "#00B0AD", "#721D47", "#EA4833",
                            "#EF937E", "#F37521", "#A12059", "#126881", "#8BC240",
                            "#364D5B", "#C7DC5B", "#0094BC", "#E4126B", "#43B76E",
                            "#7BCFE9", "#B71C46"

        };


        public static Color ChangeColorBrightness(Color color, double correctionFactor) {

            double red = color.R;
            double green = color.G;
            double blue = color.B;

            if (correctionFactor < 0)
            {
                correctionFactor = 1 + correctionFactor;
                red = red * correctionFactor;
                green = green * correctionFactor;
                blue = blue * correctionFactor;

            }
            else
            {
                red = (255 - red) * correctionFactor + red;
                green = (255 - green) * correctionFactor + green;
                blue = blue * correctionFactor + blue;
            }
            return Color.FromArgb(color.A,(byte)red,(byte)green,(byte)blue);
        }
    }
}
